package com.smm.web.vmc.domain.relation;

import com.smm.web.vmc.domain.Receipt;
import com.smm.web.vmc.domain.User;

import javax.persistence.*;
import java.io.Serializable;

/**
 * Created by zhenghao on 2016/8/26.
 * 用户与仓单关联关系对象
 * 由于用户与仓单存在 多对多关系，故单独创建关系对象
 */
@Entity
@Table(name="userreceiptrelation")
public class UserReceiptRelation implements Serializable {

    private int id;

    private User user;

    private Receipt receipt;

    @Id
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @ManyToOne
    @JoinColumn(name = "user_id")
    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    @ManyToOne
    @JoinColumn(name = "receipt_no")
    public Receipt getReceipt() {
        return receipt;
    }

    public void setReceipt(Receipt receipt) {
        this.receipt = receipt;
    }
}
